<div class="easyui-layout" data-options="fit:true,border:false">
    <div data-options="region:'center',border:false" title="" style="overflow: hidden;padding: 3px;">
        <form id="roleEditForm" action="#(ctx)/admin/roleMenu/roleEdit" method="post">
            <input type="hidden" name="roleId" value="#(role.roleId??)">
            <table class="grid">
                <tr>
                    <div class="form-item">
                        <td><label for="" class="label-top">角色名称：</label></td>
                        <td><input name="roleName" class="easyui-validatebox easyui-textbox" prompt="请输入角色名称"
                                   data-options="required:true,validType:'length[3,10]'" value="#(role.roleName??)" readonly>
                        </td>
                    </div>
                </tr>
                <tr>
                    <div class="form-item">
                        <td><label for="" class="label-top">描述：</label></td>
                        <td><input name="roleDesc" class="easyui-validatebox easyui-textbox" prompt="请输入描述"
                                   data-options="required:true,validType:'length[3,10]'" value="#(role.roleDesc??)">
                        </td>
                    </div>
                </tr>
            </table>
        </form>
    </div>
</div>
<script>
    $(document).ready(function () {
        var roleEditForm = $('#roleEditForm')
        roleEditForm.ajaxForm({
            dataType: "json",
            beforeSubmit: function () {
                progressLoad();
                var isValid = $('#roleEditForm').form('validate');
                if (!isValid) {
                    progressClose();
                    parent.$.messager.show({
                        title: '警告',
                        msg: '您的输入不合法',
                        timeout: 3000,
                        showType: 'slide'
                    });
                }
                return isValid;
            },
            success: function (response) {
                progressClose();
                if (response.result) {
                    parent.$.modalDialog.openner_dataGrid.datagrid('reload');//之所以能在这里调用到parent.$.modalDialog.openner_dataGrid这个对象，是因为user.jsp页面预定义好了
                    parent.$.modalDialog.handler.dialog('close');
                } else {
                    var msg = JSON.stringify(response.msg);
                    parent.$.messager.alert('提示', msg, 'warning');
                }
                return;
            }
        });
    });
</script>